﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Product.App.AppServices;
using Product.App.Dtos;
using Util;

namespace Product.Api.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class ProductsController : ControllerBase
    {
        //构造函数注入
        private readonly IProductAppService _productAppService;
        public ProductsController(IProductAppService productAppService)
        {
            _productAppService = productAppService;
        }


        public async Task<ResultEntity<bool>> CreateProductAsync([FromBody]AddProductSPUInputDto addProductSPU)
        {
            await _productAppService.CreateProductSPUAsync(addProductSPU);
            return new ResultEntity<bool>();
        }
    }
}